package com.dacool.model;

import java.io.Serializable;
import java.util.ArrayList;

public class DaCoolTransactionBill implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7729719467056751991L;

	public String dateString;
	public int status;
	public String iconUrl;
	public long billId;
	public String amount;
	public String orderNo;
	public double totalPrice;
	public String statusLabel;
	public String priceLabel;
	public String deliveryFee;
	public String dacoolMoney;
	public String sumPrice;
	public String deliverAddr;
	public String deliverArea;
	public String deliverMan;
	public String deliverMobile;
	public String deliverTime;
	public String invoice;

	public String shipStatus;
	public String payStatus;
	public String confirmed;

	public String payMethod;

	public ArrayList<CartItem> items = new ArrayList<CartItem>();

	public String getOrderStatusString() {
		if ("finish".equalsIgnoreCase(statusLabel)) {
			return "已完成";
		} else if ("dead".equalsIgnoreCase(statusLabel)) {
			return "已作废";
		} else {
			String payString = null;
			// 0:未支付;1:已支付;2:已付款至到担保方;3:部分付款;4:部分退款;5:全额退款;
			payString = "0".equals(payStatus) ? "未支付"
					: "1".equals(payStatus) ? "已支付"
							: "2".equals(payStatus) ? "已付款" : "3"
									.equals(payStatus) ? "部分付款" : "4"
									.equals(payStatus) ? "部分退款" : "5"
									.equals(payStatus) ? "全额退款" : null;
			String shipString = null;
			// 0:未发货;1:已发货;2:部分发货;3:部分退货;4:已退货;

			shipString = "0".equals(shipStatus) ? "未发货" : "1"
					.equals(shipStatus) ? "已发货"
					: "2".equals(shipStatus) ? "部分发货"
							: "3".equals(shipStatus) ? "部分退货" : "4"
									.equals(shipStatus) ? "已退货" : null;
			if ("0".equals(payStatus) || "3".equals(payStatus)
					|| "4".equals(payStatus) || "5".equals(payStatus))
				return payString;
			else
				return shipString;
		}
	}
}
